﻿@using GSLMS.Entity
@using GSLMS.Entity.Enum
@model GSLMS.Entity.TB_APP_PROINFO
@{
    Layout = null;
    var ddlFinalApprover = ViewData["FinalApprover"] as SelectList;
    var directorAuditModel = ViewData["directorAuditModel"] as GSLMS.Entity.TB_APP_DIRECTORAUDIT;
    var isCanBack = (bool)ViewData["IsDirectorAuditRetract"];
    var auditList = ViewData["AuditInfo"] as List<GSLMS.Entity.TB_APP_AUDIT>;
}
<div class="pageContent">
    <form method="post" id="formDDVApplyAudit" action="RiskAudit/Director/DirectorDefault/GApplyAudit?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
    onsubmit="return validateCallback(this, dialogAjaxDone)">
    <div class="pageFormContent"  layouth="90">
        @Html.HiddenFor(model => model.ID)
        <p>
            <label>
                申请编号：</label>
                <a href="/DianDang/Apply/ProInfo/Details/@Model.ID?OpID=@ViewData["OperateID"]" rel="GApplyAuditShowApplyDetails"   target="dialog" title="查看立项申请[@Model.CUSTNAME]">
                @Html.ValueFor(model=>model.APPLYNO)
                </a>
           
        </p>
        <p>
            <label>
                客户姓名：</label>
            @Html.ValueFor(model => model.CUSTNAME)
        </p>
        <p>
            <label>
                证件号码：</label>
            @Html.ValueFor(model => model.CUSTNO)
        </p>
        <p>
            <label>
                贷款类型：</label>
            @((ApplyEnum.ProLoanType)Model.LOANTYPE)
        </p>
        <p>
            <label>
                业务经理：</label>
            @Html.ValueFor(model => model.SALESMAN)
        </p>
        <p>
            <label>
                所属部门：</label>
            @Html.ValueFor(model => model.DEPNAME)
        </p>
        <p>
            <label>
                申请日期：</label>
            @Model.APPDATE.Value.ToString("yyyy-MM-dd")
        </p>
        <p>
            <label>
                业务类型：</label>
           @((ApplyEnum.RegBussType)Model.BUSSTYPE)
        </p>
        <p>
            <label>
                贷款产品：</label>
            @Html.ValueFor(model => model.PRODUCTNAME)
        </p>
        <p>
            <label>
                中介人：</label>
            @Html.ValueFor(model => model.MEDIATOR)
        </p>
         <p>
            <label>
                中介人账号：</label>
            @Html.ValueFor(model => model.MEDIATORACCOUNT)
        </p>
        <p>
            <label>
                存在特批：</label>
            @*@Html.CheckBoxFor(model => (model.ISSPECIAL==1))*@
        </p>
        <p>
            <label>
                跟进风控：</label>
          
        </p>
         <p>
            <label>
                借款金额：</label>
            @Html.ValueFor(model => model.AMOUNT)
            万元
        </p>
         <p>
            <label>
                期限：</label>
            @Html.ValueFor(model => model.LOANPHASE)
            @(Model.LOANPHAESTYPE == 0 ? "天" : "月")
        </p>
        <p>
            <label>
                综合费率：</label>
            @Html.ValueFor(model => model.GENERALRATE)
            %
        </p>
         <p>
            <label>
                利率：</label>
            @Html.ValueFor(model => model.RATE)
            %
        </p>
         <p>
            <label>
                管理费率：</label>
            @Html.ValueFor(model => model.MANAGEFEERATE)
            %
        </p>
        @if (Model.BUSSTYPE == 3)
        {
         <p>
            <label>
                还款方式：</label>
            @((ApplyEnum.ProRepayment)Model.ProForHouInfo.SPAREFIELD1)
        </p>
        }
        else
        { 
          <p>
            <label>
                还款方式：</label>
           @((ApplyEnum.ProRepayment)Model.ProUnForHouInfo.REPAYMENT)
        </p>
        }
        
        <p>
           <a href="DianDang/FKAudit/RiskControl/@(Model.BUSSTYPE==3?"CreateHouInfo":"CreateUnHouInfo")/@(Model.ID)?riskstatus=1"   rel="GApplyAuditShowRiskControl"   target="dialog" title="查看立项申请[@Model.CUSTNAME]风控调查报告">风控调查报告</a>
        </p>
        @if (Model.BUSSTYPE != 3)
        { 
        <p>
           <a href="DianDang/Apply/ProInfo/ReportInfo/@Model.ID" rel="GApplyAuditShowReportInfo"    target="dialog" title="查看立项申请[@Model.CUSTNAME]项目经理调查报告">项目经理调查报告</a>
        </p>
         <p>
            <label>
                预收费用：</label>
            @Html.ValueFor(model => model.ProUnForHouInfo.ADVAMT)
            元
        </p>
        }
        
         <div class="divider" />
           <ul>
             @foreach (var item in auditList)
             {
             <li style="line-height:25px;">
                 @(item.AUDITTIME == null ? "" : item.AUDITTIME.Value.ToString("yyyy年MM月dd日"))【@item.AUDITBY】审批@((ApplyEnum.ProAuditResult)item.AUDITRESULT)，意见：@item.AUDITCONTENT
             </li>
             }
           </ul>
         <div class="divider" />
        <p>
            <label>
                @(directorAuditModel.AUDITRESULT == 1 ? "意见" : ((ApplyEnum.ProAuditResult)directorAuditModel.AUDITRESULT + "原因"))
                    ：</label>
            @directorAuditModel.AUDITCONTENT
        </p>
        <p style="display:@(directorAuditModel.AUDITRESULT==1?"inline":"none")">
            <label>
                提交到：</label>
            @((directorAuditModel.TOUSER!=null&&directorAuditModel.TOUSER.Trim() == "001") ? "贷款审议" : directorAuditModel.TOUSER)
        </p>
        <p>
            <label>
                审批时间：</label>
            @directorAuditModel.AUDITTIME.Value.ToString("yyyy-MM-dd HH:mm:ss")
        </p>
        <p>
            <label>
                审批结论：</label>
            @((ApplyEnum.ProAuditResult)directorAuditModel.AUDITRESULT)
          
        </p>
           <p style="width: 95%; height:85px;@(isCanBack ? "" : "display:none")">
            <label>
                撤回原因：</label>
            @Html.TextArea("AuditContent", new { style = "width:75%;height:60px" })

            @Html.Hidden("hidActiondo")
        </p>
    </div>
    <div class="formBar" style="@(isCanBack ? "" : "display:none;")">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" disabled="disabled" onclick="GApplyAudit(1)">
                            同意</button></div>
                </div>
            </li>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" disabled="disabled" onclick="GApplyAudit(2)">
                            拒绝</button></div>
                </div>
            </li>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" disabled="disabled" onclick="GApplyAudit(3)">
                            退回</button></div>
                </div>
            </li>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" @(!isCanBack ? "disabled='disabled'" : "")  onclick="GApplyAudit(4)">
                            撤回</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>
<script type="text/javascript">
    function GApplyAudit(action) {
        $form = $("#formDDVApplyAudit");
        $("#hidActiondo", $form).val(action);
        var Remark = $("#AuditContent", $form).val();
        var touser = $("#toUser", $form).val();
        if (action < 4) {
            
            if (Remark) {
                if (action == 1) {
                    if (touser) {
                        validateCallback($form, dialogAjaxDone, "您确定要同意此笔立项申请吗？");
                    }
                    else {
                        alertMsg.error("请选择提交到!");
                    }
                }
                else {
                    validateCallback($form, dialogAjaxDone, (action == 2 ? "您确定要拒绝此笔立项申请吗？" : "您确定要退回此笔立项申请吗？"));
                }
            }
            else {
                alertMsg.error("请输入意见!");
            }

        }
        else {
           if(Remark)
               validateCallback($form, dialogAjaxDone, "您确定要撤回对此笔立项申请的审批吗？");
            else
                alertMsg.error("请输入撤回原因!");
        }
    }
</script>
